package com.pengcheng.taskapplication.mvp.view.activity;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.pengcheng.taskapplication.R;
import com.pengcheng.taskapplication.mvp.view.widget.FlowLayout;
import com.pengcheng.taskapplication.rxbus.RxBus;
import com.pengcheng.taskapplication.rxbus.RxBusRoute;
import com.pengcheng.taskapplication.rxbus.RxEvent;

import butterknife.BindView;
import butterknife.OnClick;

public class SearchActivity extends BaseActivity{
    @BindView(R.id.fl_layout)
    FlowLayout fl_layout;

    @BindView(R.id.tv_cancel)
    TextView tv_cancel;

    @Override
    protected int layoutResID() {
        return R.layout.activity_search;
    }

    @Override
    protected void initData() {
        fl_layout.setHorizontalSpacing(20);
        fl_layout.setVerticalSpacing(20);
        tv_cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.finish();
            }
        });
    }


    @OnClick({R.id.tv_wash,R.id.tv_park,R.id.tv_w_order,R.id.tv_p_order,R.id.tv_money,R.id.tv_anzhuang})
    public void onViewClicked(View view) {
        Intent intent ;
        switch (view.getId()) {
            case R.id.tv_wash:
                intent = new Intent(context, ParkWashActivity.class);
                startActivity(intent);
                context.finish();
                break;
            //添加绑卡
            case R.id.tv_park:
                intent = new Intent(context, ParkScanActivity.class);
                startActivity(intent);
                context.finish();
                break;
            case R.id.tv_w_order:
                RxBus.getInstance().post(new RxEvent(RxBusRoute.Wash));
                context.finish();
                break;
            case R.id.tv_p_order:
                RxBus.getInstance().post(new RxEvent(RxBusRoute.Park));
                context.finish();
                break;
            case R.id.tv_money:
                intent =new Intent(context, MyWalletBankList.class);
                startActivity(intent);
                context.finish();
                break;
            case R.id.tv_anzhuang:
                //RxBus.getInstance().post(new RxEvent(RxBusRoute.Park));
                break;
        }
    }
}
